package cn.zxl.graduate.domain;

import cn.zxl.graduate.mapper.UserMapper;
import cn.zxl.graduate.service.IUserService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.List;

/**
 * @Date 2021/11/1 14:31
 * @Version 1.0
 * @Description
 */
@SpringBootTest
public class test {
    @Autowired
    private IUserService userService;
    @Autowired
    private UserMapper userMapper;

    @Test
    public void test1() throws Exception {
        List<User> list = userService.list(null);
        System.out.println(list);

        System.out.println("true = " + true);
    }

    @Test
    public void testRe() throws Exception {
        User user = new User();
        user.setId(3L);
        user.setUsername("xiaolong4");
        user.setPassword("wwwww");
        user.setNickname("呲呲呲");
        user.setEmail("5555");
        user.setPhone("12323112");
        userMapper.updateById(user);
    }

    @Test
    public void testTrue() throws Exception {
        String psw = "asd";
        String rpsw = "asd1";
        isTrue(!psw.equals(rpsw),"两次输入的密码不相同");
    }

    public void isTrue(boolean isTrue,String msg) {
        if (isTrue) {
            System.out.println(msg);
        }
    }
}
